package de.andreavicentini.teatralia.pages;

import java.text.MessageFormat;

import org.magiclabs.htmlx.ToggleHeader;

public class ToggleHeaderDoubleTitle extends ToggleHeader {

	private final String toggleTitle;

	public ToggleHeaderDoubleTitle(String id, String toggleTitle, String title, String style) {
		super(id, title, style);
		this.toggleTitle = toggleTitle;
	}
	
//	public String toString() {
//		return 
//			"<div class=\"" + this.style + "\" style=\"border-bottom:0px\"><h3>" + this.toggleTitle + this.title + "</h3></div>\n" +
//			"<div class=\"" + this.style + "\" id=\"" + this.id + "\">";
//	}
	
	public String toString() {
		return MessageFormat.format("" +
				"<div class=\"{0}\" style=\"border-bottom:0px; text-align:left\"><h3><a onclick=\"javascript:toggle(''{1}'');\">{2}</a>{3}</h3></div>\n" +
				"<div class=\"" + this.style + "\" id=\"" + this.id + "\">",
				new String[] { this.style, this.id, this.toggleTitle, this.title
		});
//		"<div class=\"" + this.style + "\" style=\"border-bottom:0px; text-align:left\"><h3>" +
//		"<a onclick=\"javascript:toggle('" + this.id + "');\"  style=\"width=81%\">" + this.toggleTitle + "</a>" + this.title +
//		"</h3></div>\n" +
//		"<div class=\"" + this.style + "\" id=\"" + this.id + "\">";
	}
}
